MaxConnections setting

All requests to the appservers flow through the HTTP Server plug-in. The application server selection logic in the plug-ins has been enhanced so that it takes into account the number of pending connections to the application server. The MaxConnections attribute is used to specify the maximum number of pending connections to an application server that can be flowing through a Web server process at any point in time.

The plug-in config file has a new attribute MaxConnections for the Server definition as shown in Example 5-23. This feature is disabled if the value is set to -1 or 0. By default, the value is set to -1. The attribute can be set to the maximum number of pending connections to the appserver through the plug-in.

Example 5-23 MaxConnections Server attribute in plugin-cfg.xml file

..
   <ServerCluster CloneSeparatorChange="false" LoadBalance="Round Robin" Name="PluginCluster" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server CloneID="v544d031" ConnectTimeout="0" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="10" Name="was1node_PluginMember1" WaitForContinue="false">
         <Transport Hostname="app1.itso.ibm.com" Port="9088" Protocol="http"/>
      </Server>
      <Server CloneID="v544d0o0" ConnectTimeout="0" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="10" Name="was2Node_PluginMember2" WaitForContinue="false">
         <Transport Hostname="app2.itso.ibm.com" Port="9086" Protocol="http"/>
      </Server>
      <PrimaryServers>
         <Server Name="was1node_PluginMember1"/>
         <Server Name="was2Node_PluginMember2"/>
      </PrimaryServers>
   </ServerCluster>
..

For example, let the two appservers be fronted by one node running IBM HTTP Server. If the MaxConnections attribute is set to 10, then each application server could potentially get up to 10 pending connections.

If the number of pending connections reaches the maximum limit of the appserver, then it is not selected to handle the current request. If no other application server is available to serve the request, HTTP response code 503 (Service unavailable) is returned to the user.

This can be seen in the plugin trace listing in Example 5-24.

Example 5-24 Plug-in trace when MaxConnections is set

..
### When the request comes, it is pended.
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 0, maxConnectionsCount 10.
TRACE: ws_server_group: lockedServerGroupUseServer: Server was1node_PluginMember1 picked, weight 0.
TRACE: ws_server_group: serverGroupIncrementConnectionCount: Server was1node_PluginMember1 picked, pendingConnectionCount 1 totalConnectionsCount 1.
TRACE: ws_common: websphereFindTransport: Finding the transport

### When the next request comes, it is pended again.
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 1, maxConnectionsCount 10.
TRACE: ws_server_group: lockedServerGroupUseServer: Server was1node_PluginMember1 picked, weight 0.
TRACE: ws_server_group: serverGroupIncrementConnectionCount: Server was1node_PluginMember1 picked, pendingConnectionCount 2 totalConnectionsCount 2.
TRACE: ws_common: websphereFindTransport: Finding the transport

### When the number of pending connections reaches the MaxConnections(in this case, 10), the HTTP reqponse code 503 is returned to the user.

TRACE: ws_server_group: serverGroupGetFirstPrimaryServer: getting the first primary server
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 10, maxConnectionsCount 10.
STATS: ws_server_group: serverGroupCheckServerStatus: Checking status of was1node_PluginMember1, ignoreWeights 0, markedDown 0, retryNow 0, wlbAllows 1 reachedMaxConnectionsLimit 1
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 10, maxConnectionsCount 10.
WARNING: ws_server_group: serverGroupCheckServerStatus: Server was1node_PluginMember1 has reached maximmum connections and is not selected
TRACE: ws_server_group: serverGroupGetNextPrimaryServer: getting the next primary server
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 10, maxConnectionsCount 10.
STATS: ws_server_group: serverGroupCheckServerStatus: Checking status of was2Node_PluginMember2, ignoreWeights 0, markedDown 0, retryNow 0, wlbAllows 1 reachedMaxConnectionsLimit 1
TRACE: ws_server: serverHasReachedMaxConnections: currentConnectionsCount 10, maxConnectionsCount 10.
WARNING: ws_server_group: serverGroupCheckServerStatus: Server was2Node_PluginMember2 has reached maximmum connections and is not selected
ERROR: ws_server_group: serverGroupNextRoundRobinServer: Failed to find a server; all could be down or have reached the maximimum connections limit
WARNING: ws_common: websphereFindServer: Application servers have reached maximum connection limit
ERROR: ws_common: websphereWriteRequestReadResponse: Failed to find a server
ERROR: ESI: getResponse: failed to get response: rc = 8
TRACE: ESI: esiHandleRequest: failed to get response
TRACE: ESI: esiRequestUrlStackDestroy
TRACE: ESI: esiRequestPopUrl: '/wlm/beenthere'
TRACE: ESI: esiUrlDestroy: '/wlm/beenthere'
ERROR: ws_common: websphereHandleRequest: Failed to handle request
TRACE: ws_common: websphereCloseConnection
TRACE: ws_common: websphereEndRequest: Ending the request
..

As mentioned earlier, when the plug-in detects that there are no appservers available to satisfy the request, HTTP response code 503 (Service unavailable) is returned. This response code appears in the Web server access log, as shown in Example 5-25.

Example 5-25 HTTP Server access log example

[08/Dec/2003:14:08:03 -0500] "GET /wlm/beenthere HTTP/1.0" 503 419
[08/Dec/2003:14:08:03 -0500] "GET /wlm/beenthere HTTP/1.0" 503 419
[08/Dec/2003:14:08:03 -0500] "GET /wlm/beenthere HTTP/1.0" 503 419

This feature helps you to better load balance the appservers fronted by the plug-in. If application servers are overloaded, the plug-in will automatically skip these application servers and try the next available application server.

This feature solves the main problem of appservers taking a long time to respond to requests. It is achieved by throttling the number of connections going to the application server through the plug-in.

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.